How can I open another tab in the browser from the Code Behind [duplicate]

Posted by Daniel Powell on Stack Overflow See other posts from Stack Overflow or by Daniel Powell
Published on 2014-06-11T21:14:29Z Indexed on 2014/06/11 21:24 UTC
Read the original article Hit count: 158

Filed under:
|

This question already has an answer here:

I have an ASP.Net project that I am working on that involves opening another tab in the browser from the vb.net (code behind). I have tried to use the WebBrowser control to open the new tab as well as tried to use the Script manager however I have not been able to open the new tab. The button I am using is a custom button in a DevExpress GridView, and I am handling its click with this code:

Private Sub ASPxGridView2_CustomButtonCallback(sender As Object, e As DevExpress.Web.ASPxGridView.ASPxGridViewCustomButtonCallbackEventArgs) Handles ASPxGridView2.CustomButtonCallback
    If e.ButtonID <> "customButton" Then
        Return
    End If
    Dim neededID = ASPxGridView2.GetRowValues(e.VisibleIndex, "target")
    Dim id = CStr(neededID)
    Dim url = ("targetPage.aspx" + "?ID=" + id)

    Dim wb As WebBrowser
    wb.Navigate(url,True)

End Sub

I'm not sure why this would not work, any suggestions as to how I should open a new browser tab with or without the WebBrowser works for this project.

EDIT: I cannot use javascript with this ASPxGridview So I need an answer that doesn't involve modification to the javascript except through the vb.net code behind

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about vb.net